package com.test.gk;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Timer;
import java.util.TimerTask;

public class Main {
    public static void main(String[] args) {
        new Timer().scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                Logger logger = LoggerFactory.getLogger(this.getClass());
                System.out.println("aaa");
                try {
                    int b = 10 / 0;
                } catch (Exception e) {
                    logger.error("程序运行异常，异常信息如下：", e);
                }
            }
        }, 1000, 1000);
    }
}